<template>
    <!-- header -->
    <Header></Header>
    <!-- nav -->
    <Nav></Nav>

    <div class="news-detail">
        <h2 class="news-detail-title">{{ detail.name }}</h2>
        <p class="news-detail-time">{{ detail.created_at }}</p>
        <div v-html="detail.content" class="news-detail-text">
            
        </div>
    </div>

    <!-- foot -->
    <Footer></Footer>
</template>
<script>
import Header from "../../../components/web/Header";
import Nav from "../../../components/web/Nav";
import Footer from "../../../components/web/Footer";
export default {
    name: "List",
    components:{
        Header,
        Nav,
        Footer
    },
    setup(){
    // let store = useStore();
    // let cart = computed(() => {
    //   return store.state.cart
    // })

    // return {
    //   cart
    // }
    },
    data() {
        return {
            detail: []
        }
    },
    methods: {
        
    },
    async created(){
        try{
            let params = this.$route.params;
            
            // const items = await this.$http.post('/api/banner')
            const detail = await this.$http.post('/scanapi/api/v1/web/news/detail/' + params.id)
            console.log(detail);
            this.detail = detail.data
        }catch(err){
            console.log(err)
        }
    }
}
</script>